package com.example.check_oa.controller;

import com.example.check_oa.model.service.HolidayTypeService;
import com.example.comment_oa.response.AjaxResponse;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("checkOa/holiType")
@CrossOrigin
public class HolidayTypeController {
    @Resource
    HolidayTypeService holidayTypeService;

    //查询假期余额
    @PostMapping("/query/{userNo}")
    public AjaxResponse query(@PathVariable String userNo){
        return AjaxResponse.success(holidayTypeService.holiNum(userNo));
    }

    //查询假期类型
    @PostMapping("/select/{sex}")
    public AjaxResponse select(@PathVariable("sex")int sex){
        return AjaxResponse.success(holidayTypeService.holiType(sex));
    }
}
